function ToggleCalendarFilter(AjaxUrl, CalendarID, Block, SenderID, PostBackKey, RefreshPage)
{
	var Sender = document.getElementById(SenderID);
	if (Sender) Sender.className = 'PreferenceProgress';

	var Parameters = "BlockCalendarID="+CalendarID+"&Block="+Block+"&PostBackKey="+PostBackKey;
	var dm = new DataManager();
	dm.Param = SenderID;
	dm.RequestFailedEvent = HandleFailure;
	if (RefreshPage)
		dm.RequestCompleteEvent = RefreshPageWhenAjaxComplete;
	else
		dm.RequestCompleteEvent = CalendarFilterSet;
	
	dm.LoadData(AjaxUrl+"?"+Parameters);
}

function CalendarFilterSet(Request)
{
	setTimeout("CompleteCalendarFilterSet('"+this.Param+"');", 400);
}

function CompleteCalendarFilterSet(SenderID)
{
	 var Container = document.getElementById(SenderID);
	 if (Container) Container.className = 'PreferenceComplete';
}